<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/markets/Market.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/markets/Market.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'MarketId',
                footer: "Foots",
                cnName: '销售信息',
                name: 'markets/Market',
                url: "/Market/",
                sortName: "MarketId"
            });
            const editFormFields = ref({"MarketId":"","MarketbillsType":"","ClientId":"","ClientName":"","ClientPhone":"","ReceiptDate":"","Remark":"","DocumentMaker":"","MakeOrderTime":"","MarketState":"","IsEntry":"","IsSendBack":"","CreateTime":""});
            const editFormOptions = ref([[{"title":"销售单号","required":true,"field":"MarketId","disabled":true},
                               {"dataKey":"单据类型","data":[],"title":"单据类型","field":"MarketbillsType","type":"select"},
                               {"dataKey":"客户下拉框绑定","data":[],"title":"客户编号","field":"ClientId","type":"select"}],
                              [{"title":"客户名称","field":"ClientName"}],
                              [{"title":"客户电话号码","field":"ClientPhone"}],
                              [{"title":"发货日期","field":"ReceiptDate"}],
                              [{"title":"备注","field":"Remark"}],
                              [{"title":"制单人","field":"DocumentMaker"}],
                              [{"title":"制单日期","field":"MakeOrderTime"}],
                              [{"dataKey":"应收状态","data":[],"title":"状态","field":"MarketState","type":"select"}],
                              [{"dataKey":"是否","data":[],"title":"是否入账","field":"IsEntry","type":"radio"}],
                              [{"title":"是否退货","field":"IsSendBack"}],
                              [{"title":"创建时间","field":"CreateTime"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'MarketId',title:'销售单号',type:'string',sort:true,width:220,readonly:true,require:true,align:'left',sort:true},
                       {field:'MarketbillsType',title:'单据类型',type:'int',bind:{ key:'单据类型',data:[]},width:110,align:'left'},
                       {field:'ClientId',title:'客户编号',type:'string',bind:{ key:'客户下拉框绑定',data:[]},width:220,align:'left'},
                       {field:'ClientName',title:'客户名称',type:'string',width:220,align:'left'},
                       {field:'ClientPhone',title:'客户电话号码',type:'string',width:110,align:'left'},
                       {field:'ReceiptDate',title:'发货日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Remark',title:'备注',type:'string',width:180,align:'left'},
                       {field:'DocumentMaker',title:'制单人',type:'string',width:110,align:'left'},
                       {field:'MakeOrderTime',title:'制单日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'MarketState',title:'状态',type:'int',bind:{ key:'应收状态',data:[]},width:110,align:'left'},
                       {field:'IsEntry',title:'是否入账',type:'sbyte',bind:{ key:'是否',data:[]},width:110,align:'left'},
                       {field:'IsSendBack',title:'是否退货',type:'sbyte',width:110,hidden:true,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'是否删除',type:'sbyte',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
